package com.example.demo.controller;

import com.example.demo.config.UserConfiguration;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserController3 {
    //Setter注入

    private UserService service;
    private UserConfiguration userConfiguration;

    public void hi(){
        userConfiguration.sayHi();
        service.sayHi();
        System.out.println("hi,UserController3");
        System.out.println("------------------");
    }

    @Autowired
    public void setService(UserService service) {
        this.service = service;
    }

    @Autowired
    public void setUserConfiguration(UserConfiguration userConfiguration) {
        this.userConfiguration = userConfiguration;
    }
}
